package nc.uapbd.vo.sever.ipm;

import nc.bs.framework.common.NCLocator;
import nc.bs.uapbd.listener.ReceivableListener;
import nc.bs.uapbd.listener.ReceivableSHListener;
import nc.bs.uapbd.listener.SaleInvoiceListener;
import nc.bs.uapbd.listener.SettleListener;
import nc.itf.so.m32.ISaleInvoiceScriptMaintain;
import nc.itf.to.m5f.ISettleMaintain;
import nc.itf.uap.pf.IplatFormEntry;
import nc.pub.feikai.BaseDaoUtil;
import nc.uapbd.vo.sever.ListenerSever;
import nc.vo.arap.receivable.AggReceivableBillVO;
import nc.vo.arap.receivable.ReceivableBillVO;
import nc.vo.pub.AggregatedValueObject;
import nc.vo.pub.BusinessException;
import nc.vo.pub.workflownote.WorkflownoteVO;
import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill;
import nc.vo.so.m32.entity.SaleInvoiceVO;
import nc.vo.to.m5f.entity.SettleListVO;

import java.util.HashMap;

public class ListenerSeverIpm implements ListenerSever{

	@Override
	public void saleInvoice(SaleInvoiceVO[] saleInvoiceVOs) throws BusinessException {
		new SaleInvoiceListener().exe(saleInvoiceVOs);
	}

	@Override
	public void receivableBill(AggReceivableBillVO[] parentVO) throws BusinessException {
		// TODO Auto-generated method stub
		new ReceivableListener().exe(parentVO);
	}

	@Override
	public void receivableBillSH(AggReceivableBillVO[] parentVO) throws BusinessException {
		new ReceivableSHListener().exe(parentVO);
	}

	@Override
	public void updataSH(String id) throws BusinessException {
		new ReceivableSHListener().exeid(id);
	}


	@Override
	public void settleListener(SettleListVO[] settleListVOS) throws BusinessException {
		new SettleListener().exe(settleListVOS);
	}

	@Override
	public Object executeUapbd__RequiresNew(String var1, String var2,WorkflownoteVO workflownoteVO ,AggregatedValueObject var4) throws Exception {


		Object obj= NCLocator.getInstance().lookup(IplatFormEntry.class).processAction(var1, var2, workflownoteVO, var4, null, null);
		//NCLocator.getInstance().lookup(ISaleInvoiceScriptMaintain.class).saleInvoiceUpdate(saleInvoiceVOS,null,saleInvoiceVOS);
		System.out.println("6666");
		return obj;
	}

	@Override
	public SettleListVO executeUapbd__RequiresNew(SettleListVO listVO) throws Exception {
		ISettleMaintain service = (ISettleMaintain)NCLocator.getInstance().lookup(ISettleMaintain.class);
		SettleListVO s= service.updateSettleList(listVO);
		return s;
	}

}
